﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<IPagedList<MensUnoShop.Models.Member>>" %>
<%@ Import Namespace="MvcPaging"%>  
<%@ Import Namespace="MensUnoShop.Areas.Admin.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	MemberList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 <div id="main-content" class="hastable">
    <div class="title title-spacing">
	    <h2>會員清單</h2>
    </div>
    <%using (Html.BeginForm("MemberList", "MemberManagement", FormMethod.Post, new { @class = "shBox" }))
    {%>
      <select id="querychoice" name="querychoice">
          <option value="queryall">不限條件</option>
          <option value="queryemail">會員帳號(E-Mail)</option>
          <option value="querymname">會員姓名</option>
      </select>
      <input type="text" id="querycontent" name="querycontent" />
      <button type="submit" class="button">查詢會員</button>
    <%} %>
    <ul class="pagination">
        <%= Html.UPager(Model.PageSize, Model.PageNumber, Model.TotalItemCount)%>
    </ul>
    <table>
        <thead>
        	<tr>
                <th>帳號(E-Mail)</th>
                <th>姓名</th>
                <th>性別</th>
                <th>生日</th>
                <th>電話(O)</th>
                <th>電話(H)</th>
                <th>行動電話</th>
                <%--<th>婚姻</th>
                <th>學歷</th>
                <th>職業</th>
                <th>收入</th>--%>
                <th>國籍</th>
                <%--<th>地址</th>--%>
                <th></th>
            </tr>            
        </thead>
        
        <%if (Model != null)
            {%>            
        <tbody>
            <%foreach (var item in Model)
            {  %>
        	<tr>
                <td><%:item.EMAIL %></td>
                <td><%:item.LASTNAME %> <%:item.FIRSTNAME %></td>
                <td><%if (item.SEX) {%>男<% } else {%>女<% }%></td>
                <td><%:item.BIRTH %></td>
                <td><%:item.TELO %></td>
                <td><%:item.TELH %></td>
                <td><%:item.MOBILE %></td>
                <%--<th><%:item.ISMARRIED %></th>
                <th><%:item.EDU %></th>
                <th><%:item.JOB %></th>
                <th><%:item.INCOME %></th>--%>
                <td><%:item.COUNTRY %></td>
                <%--<th><%:item.ZIP %><%:item.CITY %><%:item.ADDRESS %><%:item.ADDRESS %></th>--%>
                <td><a id="MemberDetail" name="MemberDetail" class="iframe" href="/Admin/MemberManagement/MemberDetailView/<%:item.MGUID %>">會員資料</a></td>
            </tr>
            <%} %>
        </tbody>
        <%} %>
    </table>
    <ul class="pagination" style="margin-top:-60px;">
        <%= Html.UPager(Model.PageSize, Model.PageNumber, Model.TotalItemCount)%>
    </ul>
</div>
<script type="text/javascript">
    $("a#MemberDetail").fancybox({ height: 450, scrolling: 'no' });
</script>
</asp:Content>
